{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 用户输入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入正确账户:danm\n",
      "请输入正确的密码:danmin\n",
      "你的账号或密码不正确，请重新输入，您还有 2 次机会\n",
      "请输入正确账户:444\n",
      "请输入正确的密码:danmin\n",
      "你的账号或密码不正确，请重新输入，您还有 1 次机会\n",
      "请输入正确账户:55\n",
      "请输入正确的密码:danmin\n",
      "傻逼你的账号被锁定了，5分钟后尝试\n"
     ]
    }
   ],
   "source": [
    "user_data = \"danmin\"\n",
    "user_password = \"123456\"\n",
    "count = 3\n",
    "\n",
    "\n",
    "class Ture:\n",
    "    pass\n",
    "\n",
    "\n",
    "while Ture:\n",
    "    username = input(\"请输入正确账户:\")\n",
    "    password = input(\"请输入正确的密码:\")\n",
    "    count -=1\n",
    "\n",
    "    if username == user_data:\n",
    "       if password == user_password:\n",
    "           print(\"登录成功，欢迎\",username,\"使用~\")\n",
    "           # 什么时候退出呢？ 当账号和密码都是正确的情况下\n",
    "           break\n",
    "       else:\n",
    "           if count == 0:\n",
    "               print(\"傻逼你的账号被锁定了，2分钟后尝试\")\n",
    "               break\n",
    "           else:\n",
    "               print(\"你的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")\n",
    "    else:\n",
    "       if count == 0:\n",
    "           print(\"傻逼你的账号被锁定了，5分钟后尝试\")\n",
    "           break\n",
    "       else:\n",
    "           print(\"你的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
